

import LayoutMain from '@/layout';
import setting from '@/setting';
let routePre = setting.routePre;

const pre = 'product_';

export default {
  path: routePre + '/product',
  name: 'product',
  header: 'product',
  meta: {
    title: '商品',
    // 授权标识
    auth: ['admin-store-index'],
  },
  redirect: {
    name: `${pre}productList`,
  },
  component: LayoutMain,
  children: [
    {
      path: 'product_list',
      name: `${pre}productList`,
      meta: {
        title: '商品管理',
        auth: ['admin-store-storeProuduct-index'],
        keepAlive: true,
      },
      component: () => import('@/pages/product/productList'),
    },
    {
      path: 'warehouse_list',
      name: `${pre}warehouseList`,
      meta: {
        title: '仓库管理',
        auth: ['admin-store-storeWarehouse-index'],
        keepAlive: true,
      },
      component: () => import('@/pages/product/warehouseList'),
    },
    {
      path: 'banner_list',
      name: `${pre}bannerList`,
      meta: {
        title: '品牌管理',
        auth: ['admin-store-storeBanner-index'],
        keepAlive: true,
      },
      component: () => import('@/pages/product/bannerList'),
    },
    {
      path: 'supplier_list',
      name: `${pre}supplierList`,
      meta: {
        title: '供应商管理',
        auth: ['admin-store-storeSupplier-index'],
        keepAlive: true,
      },
      component: () => import('@/pages/product/supplierList'),
    },
    {
      path: 'product_classify',
      name: `${pre}productClassify`,
      meta: {
        title: '商品分类',
        auth: ['admin-store-storeCategory-index'],
      },
      component: () => import('@/pages/product/productClassify'),
    },
    {
      path: 'add_product/:id?',
      name: `${pre}productAdd`,
      meta: {
        auth: ['admin-store-storeProuduct-index'],
        title: '商品添加',
        activeMenu: routePre + '/product/product_list',
      },
      component: () => import('@/pages/product/productAdd'),
    },
    {
      path: 'product_reply/:id?',
      name: `${pre}productEvaluate`,
      meta: {
        auth: ['admin-store-storeProuduct-index'],
        title: '商品评论',
      },
      component: () => import('@/pages/product/productReply'),
    },
    {
      path: 'product_attr',
      name: `${pre}productAttr`,
      meta: {
        auth: ['admin-store-storeProuduct-index'],
        title: '商品规格',
      },
      component: () => import('@/pages/product/productAttr'),
    },
  ],
};
